
package Telas;

import Conexao.ConectaBD;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.view.JasperViewer;


public class Tela_Principal extends javax.swing.JFrame {

    Connection conecta;
    PreparedStatement pst;
    ResultSet rs;

    public Tela_Principal(String user) throws ClassNotFoundException {
        initComponents();
        jl_loged.setText(user);
        setSize(1283, 703);
        setLocationRelativeTo(null);
        conecta = ConectaBD.conectabd();
        Icon();
    }
    
//<----------------------------------------------------------------------------------------------------------------------------------------->    

    private void Icon(){
    
        setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("assistec_icon.png")));
        
    }    

    Tela_Principal() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }


    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        jb_regproduto = new javax.swing.JButton();
        jLabel18 = new javax.swing.JLabel();
        jb_gervendas = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        jl_loged = new javax.swing.JLabel();
        jb_cadcliente = new javax.swing.JButton();
        jb_ordemservico = new javax.swing.JButton();
        jb_registrarvenda = new javax.swing.JButton();
        jb_gerenciaros = new javax.swing.JButton();
        jb_agenda = new javax.swing.JButton();
        jb_cadusuario = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel8 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jb_cadastrarfuncionario = new javax.swing.JButton();
        jb_contatos = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jm_cadastrousuario = new javax.swing.JMenuItem();
        jm_solicitacoes = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jm_os = new javax.swing.JMenuItem();
        jm_vendas = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jm_sobreassistec = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("AssisTec - Menu Principal");
        setResizable(false);
        getContentPane().setLayout(null);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_sair.png"))); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1);
        jButton1.setBounds(740, 600, 41, 40);

        jLabel10.setBackground(new java.awt.Color(255, 255, 255));
        jLabel10.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel10.setForeground(new java.awt.Color(255, 255, 255));
        jLabel10.setText("REGISTRAR PRODUTO");
        getContentPane().add(jLabel10);
        jLabel10.setBounds(820, 240, 140, 14);

        jb_regproduto.setBackground(new java.awt.Color(255, 255, 255));
        jb_regproduto.setForeground(new java.awt.Color(255, 255, 255));
        jb_regproduto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_registrarproduto.png"))); // NOI18N
        jb_regproduto.setToolTipText("Registrar Produtos ou Serviços");
        jb_regproduto.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        jb_regproduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_regprodutoActionPerformed(evt);
            }
        });
        getContentPane().add(jb_regproduto);
        jb_regproduto.setBounds(810, 80, 150, 150);

        jLabel18.setBackground(new java.awt.Color(255, 255, 255));
        jLabel18.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel18.setForeground(new java.awt.Color(255, 255, 255));
        jLabel18.setText("GERENCIAR VENDAS");
        getContentPane().add(jLabel18);
        jLabel18.setBounds(580, 500, 130, 14);

        jb_gervendas.setBackground(new java.awt.Color(255, 255, 255));
        jb_gervendas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_gerenciarvendas.png"))); // NOI18N
        jb_gervendas.setToolTipText("Gerenciar Vendas");
        jb_gervendas.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        jb_gervendas.setBorderPainted(false);
        jb_gervendas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_gervendasActionPerformed(evt);
            }
        });
        getContentPane().add(jb_gervendas);
        jb_gervendas.setBounds(570, 340, 150, 150);

        jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_loged.png"))); // NOI18N
        getContentPane().add(jLabel9);
        jLabel9.setBounds(530, 610, 30, 30);

        jl_loged.setBackground(new java.awt.Color(255, 255, 255));
        jl_loged.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        jl_loged.setForeground(new java.awt.Color(255, 255, 255));
        jl_loged.setToolTipText("");
        jl_loged.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        getContentPane().add(jl_loged);
        jl_loged.setBounds(570, 610, 160, 30);

        jb_cadcliente.setBackground(new java.awt.Color(255, 255, 255));
        jb_cadcliente.setForeground(new java.awt.Color(78, 78, 78));
        jb_cadcliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_analisar.jpeg"))); // NOI18N
        jb_cadcliente.setToolTipText("Registra e Gerencia Análises");
        jb_cadcliente.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
        jb_cadcliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_cadclienteActionPerformed(evt);
            }
        });
        getContentPane().add(jb_cadcliente);
        jb_cadcliente.setBounds(90, 80, 150, 150);

        jb_ordemservico.setBackground(new java.awt.Color(255, 255, 255));
        jb_ordemservico.setForeground(new java.awt.Color(78, 78, 78));
        jb_ordemservico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_os.png"))); // NOI18N
        jb_ordemservico.setToolTipText("Registrar O.S.");
        jb_ordemservico.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
        jb_ordemservico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_ordemservicoActionPerformed(evt);
            }
        });
        getContentPane().add(jb_ordemservico);
        jb_ordemservico.setBounds(330, 80, 150, 150);

        jb_registrarvenda.setBackground(new java.awt.Color(78, 78, 78));
        jb_registrarvenda.setForeground(new java.awt.Color(78, 78, 78));
        jb_registrarvenda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_vendas.png"))); // NOI18N
        jb_registrarvenda.setToolTipText("Registrar Vendas");
        jb_registrarvenda.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
        jb_registrarvenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_registrarvendaActionPerformed(evt);
            }
        });
        getContentPane().add(jb_registrarvenda);
        jb_registrarvenda.setBounds(570, 80, 150, 150);

        jb_gerenciaros.setBackground(new java.awt.Color(78, 78, 78));
        jb_gerenciaros.setForeground(new java.awt.Color(78, 78, 78));
        jb_gerenciaros.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_executados.png"))); // NOI18N
        jb_gerenciaros.setToolTipText("Gerenciar O.S.");
        jb_gerenciaros.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
        jb_gerenciaros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_gerenciarosActionPerformed(evt);
            }
        });
        getContentPane().add(jb_gerenciaros);
        jb_gerenciaros.setBounds(330, 340, 150, 150);

        jb_agenda.setBackground(new java.awt.Color(255, 255, 255));
        jb_agenda.setForeground(new java.awt.Color(78, 78, 78));
        jb_agenda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_orçamento.png"))); // NOI18N
        jb_agenda.setToolTipText("Orçamentos");
        jb_agenda.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
        jb_agenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_agendaActionPerformed(evt);
            }
        });
        getContentPane().add(jb_agenda);
        jb_agenda.setBounds(810, 340, 150, 150);

        jb_cadusuario.setBackground(new java.awt.Color(255, 255, 255));
        jb_cadusuario.setForeground(new java.awt.Color(78, 78, 78));
        jb_cadusuario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_cliente.jpg"))); // NOI18N
        jb_cadusuario.setToolTipText("Cadastrar Novo Cliente");
        jb_cadusuario.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 255, 255), 1, true));
        jb_cadusuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_cadusuarioActionPerformed(evt);
            }
        });
        getContentPane().add(jb_cadusuario);
        jb_cadusuario.setBounds(90, 340, 150, 150);

        jLabel2.setBackground(new java.awt.Color(78, 78, 78));
        jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("REGISTRAR ANÁLISE");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(100, 240, 130, 14);

        jLabel3.setBackground(new java.awt.Color(78, 78, 78));
        jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("REGISTRAR O.S.");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(360, 240, 100, 14);

        jLabel6.setBackground(new java.awt.Color(78, 78, 78));
        jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setText("REGISTRAR VENDA");
        getContentPane().add(jLabel6);
        jLabel6.setBounds(590, 240, 120, 14);

        jLabel4.setBackground(new java.awt.Color(78, 78, 78));
        jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("CADASTRAR CLIENTE");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(100, 500, 140, 14);

        jLabel5.setBackground(new java.awt.Color(78, 78, 78));
        jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel5.setForeground(new java.awt.Color(255, 255, 255));
        jLabel5.setText("ORÇAMENTO");
        getContentPane().add(jLabel5);
        jLabel5.setBounds(850, 500, 80, 14);

        jLabel7.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setText("GERENCIAR O.S.");
        getContentPane().add(jLabel7);
        jLabel7.setBounds(360, 500, 100, 14);

        jSeparator1.setForeground(new java.awt.Color(255, 255, 255));
        getContentPane().add(jSeparator1);
        jSeparator1.setBounds(70, 590, 1210, 10);

        jLabel8.setBackground(new java.awt.Color(255, 255, 255));
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("AssisTec");
        getContentPane().add(jLabel8);
        jLabel8.setBounds(10, 580, 60, 14);

        jLabel11.setBackground(new java.awt.Color(255, 255, 255));
        jLabel11.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setText("OU SERVIÇO");
        getContentPane().add(jLabel11);
        jLabel11.setBounds(840, 260, 90, 14);

        jb_cadastrarfuncionario.setBackground(new java.awt.Color(255, 255, 255));
        jb_cadastrarfuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_funcionario.png"))); // NOI18N
        jb_cadastrarfuncionario.setToolTipText("Cadastrar Funcionários");
        jb_cadastrarfuncionario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_cadastrarfuncionarioActionPerformed(evt);
            }
        });
        getContentPane().add(jb_cadastrarfuncionario);
        jb_cadastrarfuncionario.setBounds(1050, 80, 150, 150);

        jb_contatos.setBackground(new java.awt.Color(255, 255, 255));
        jb_contatos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_agenda.jpg"))); // NOI18N
        jb_contatos.setToolTipText("Contatos");
        jb_contatos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_contatosActionPerformed(evt);
            }
        });
        getContentPane().add(jb_contatos);
        jb_contatos.setBounds(1050, 340, 150, 150);

        jLabel12.setBackground(new java.awt.Color(255, 255, 255));
        jLabel12.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel12.setForeground(new java.awt.Color(255, 255, 255));
        jLabel12.setText("CADASTRAR FUNCIONÁRIO");
        getContentPane().add(jLabel12);
        jLabel12.setBounds(1040, 240, 170, 14);

        jLabel13.setBackground(new java.awt.Color(255, 255, 255));
        jLabel13.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel13.setForeground(new java.awt.Color(255, 255, 255));
        jLabel13.setText("CONTATOS");
        getContentPane().add(jLabel13);
        jLabel13.setBounds(1090, 500, 90, 14);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_fundo2.png"))); // NOI18N
        jLabel1.setPreferredSize(new java.awt.Dimension(1024, 650));
        getContentPane().add(jLabel1);
        jLabel1.setBounds(0, 0, 1280, 680);

        jMenuBar1.setBackground(new java.awt.Color(255, 255, 255));
        jMenuBar1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(78, 78, 78)));
        jMenuBar1.setForeground(new java.awt.Color(255, 255, 255));

        jMenu1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(78, 78, 78)));
        jMenu1.setText("   AssisTec   ");
        jMenu1.setBorderPainted(true);

        jm_cadastrousuario.setBackground(new java.awt.Color(255, 255, 255));
        jm_cadastrousuario.setText("Cadastrar Usuário");
        jm_cadastrousuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jm_cadastrousuarioActionPerformed(evt);
            }
        });
        jMenu1.add(jm_cadastrousuario);

        jm_solicitacoes.setText("Gerenciar Solicitações");
        jm_solicitacoes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jm_solicitacoesActionPerformed(evt);
            }
        });
        jMenu1.add(jm_solicitacoes);

        jMenuBar1.add(jMenu1);

        jMenu2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(78, 78, 78)));
        jMenu2.setText("   Relatórios   ");
        jMenu2.setBorderPainted(true);

        jm_os.setBackground(new java.awt.Color(255, 255, 255));
        jm_os.setText("Ordem de Serviço");
        jm_os.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jm_osActionPerformed(evt);
            }
        });
        jMenu2.add(jm_os);

        jm_vendas.setBackground(new java.awt.Color(255, 255, 255));
        jm_vendas.setText("Vendas");
        jm_vendas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jm_vendasActionPerformed(evt);
            }
        });
        jMenu2.add(jm_vendas);

        jMenuBar1.add(jMenu2);

        jMenu3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(78, 78, 78)));
        jMenu3.setText("   Sobre   ");
        jMenu3.setBorderPainted(true);

        jm_sobreassistec.setBackground(new java.awt.Color(255, 255, 255));
        jm_sobreassistec.setText("Sobre AssisTec");
        jm_sobreassistec.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jm_sobreassistecActionPerformed(evt);
            }
        });
        jMenu3.add(jm_sobreassistec);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void jm_osActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jm_osActionPerformed
                    try {            
                    String report = "src\\Relatorios\\RelatorioOS.jrxml";
                    JasperReport jr = JasperCompileManager.compileReport(report);
                    JasperPrint jp = JasperFillManager.fillReport(jr, null, conecta);
                    JasperViewer.viewReport(jp, false);
                    
                    
                    } catch (Exception e) {
                    }
    }//GEN-LAST:event_jm_osActionPerformed

    private void jb_cadclienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_cadclienteActionPerformed
        Tela_RegAnalise tga = null;
        try {
            tga = new Tela_RegAnalise();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
        tga.setVisible(true);
    }//GEN-LAST:event_jb_cadclienteActionPerformed

    private void jb_ordemservicoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_ordemservicoActionPerformed
        Tela_RegOS tros = null;
        try {
            tros = new Tela_RegOS();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
        tros.setVisible(true);
    }//GEN-LAST:event_jb_ordemservicoActionPerformed

    private void jb_registrarvendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_registrarvendaActionPerformed
                Tela_RegVendas trv = null;
        try {
            trv = new Tela_RegVendas();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
                trv.setVisible(true);
    }//GEN-LAST:event_jb_registrarvendaActionPerformed

    private void jb_gerenciarosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_gerenciarosActionPerformed

        Tela_GerOS ta = null;
        try {
            ta = new Tela_GerOS();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
        ta.setVisible(true);

    }//GEN-LAST:event_jb_gerenciarosActionPerformed

    private void jb_agendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_agendaActionPerformed

        Tela_Orcamento to = null;
        try {
            to = new Tela_Orcamento();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
        to.setVisible(true);

    }//GEN-LAST:event_jb_agendaActionPerformed

    private void jb_cadusuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_cadusuarioActionPerformed

        Tela_CadCliente tcc = null;

        try {
            tcc = new Tela_CadCliente();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
        tcc.setVisible(true);

    }//GEN-LAST:event_jb_cadusuarioActionPerformed

    private void jb_gervendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_gervendasActionPerformed
                Tela_GerVendas tgv = null;
        try {
            tgv = new Tela_GerVendas();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
                tgv.setVisible(true);
    }//GEN-LAST:event_jb_gervendasActionPerformed

    private void jb_regprodutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_regprodutoActionPerformed
                Tela_RegProduto trp = null;
        try {
            trp = new Tela_RegProduto();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
                trp.setVisible(true);
    }//GEN-LAST:event_jb_regprodutoActionPerformed

    private void jm_vendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jm_vendasActionPerformed
                try {            
                    String report = "src\\Relatorios\\RelatorioVenda.jrxml";
                    JasperReport jr = JasperCompileManager.compileReport(report);
                    JasperPrint jp = JasperFillManager.fillReport(jr, null, conecta);
                    JasperViewer.viewReport(jp, false);
                    
                    } catch (Exception e) {
                    }
    }//GEN-LAST:event_jm_vendasActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
                Tela_Sair ts = new Tela_Sair();
                ts.setVisible(true);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jm_cadastrousuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jm_cadastrousuarioActionPerformed
        Tela_CadUsuario tcu = null;
        try {
            tcu = new Tela_CadUsuario();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
        tcu.setVisible(true);
    }//GEN-LAST:event_jm_cadastrousuarioActionPerformed

    private void jm_sobreassistecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jm_sobreassistecActionPerformed
                Tela_Sobre ts = new Tela_Sobre();
                ts.setVisible(true);
    }//GEN-LAST:event_jm_sobreassistecActionPerformed

    private void jb_cadastrarfuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_cadastrarfuncionarioActionPerformed
                Tela_CadFuncionario tcf = null;
        try {
            tcf = new Tela_CadFuncionario();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
                tcf.setVisible(true);
    }//GEN-LAST:event_jb_cadastrarfuncionarioActionPerformed

    private void jb_contatosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_contatosActionPerformed
                Tela_Contatos tc = null;
        try {
            tc = new Tela_Contatos();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
                tc.setVisible(true);
    }//GEN-LAST:event_jb_contatosActionPerformed

    private void jm_solicitacoesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jm_solicitacoesActionPerformed
                Tela_GerSolicitacoes tgs = null;
        try {
            tgs = new Tela_GerSolicitacoes();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Tela_Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
                tgs.setVisible(true);
    }//GEN-LAST:event_jm_solicitacoesActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Tela_Principal().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JButton jb_agenda;
    private javax.swing.JButton jb_cadastrarfuncionario;
    private javax.swing.JButton jb_cadcliente;
    private javax.swing.JButton jb_cadusuario;
    private javax.swing.JButton jb_contatos;
    private javax.swing.JButton jb_gerenciaros;
    private javax.swing.JButton jb_gervendas;
    private javax.swing.JButton jb_ordemservico;
    private javax.swing.JButton jb_registrarvenda;
    private javax.swing.JButton jb_regproduto;
    private javax.swing.JLabel jl_loged;
    private javax.swing.JMenuItem jm_cadastrousuario;
    private javax.swing.JMenuItem jm_os;
    private javax.swing.JMenuItem jm_sobreassistec;
    private javax.swing.JMenuItem jm_solicitacoes;
    private javax.swing.JMenuItem jm_vendas;
    // End of variables declaration//GEN-END:variables
}
